<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cookie;


/**
 * 日志方法，直接把数据插入日志表
 */

class Power extends Controller
{   
    //验证权限
    static function validate($req){
            $key = Cookie::get('admin');
            $user = DB::table('user')->where('id',$key)->where('admin',1)->first(['id','account','email']);
            if($user){
                //正常允许登录
                return true;
            }else{
                return false;
            }
    }

}
